package cn.lijiancn01.demo.system.convert;

import com.mybatisflex.codegen.config.GlobalConfig;

import java.util.Set;

public class GlobalConfigConvert {
    public static GlobalConfig build(String basePackage, Set<String> generateTables) {
        GlobalConfig globalConfig = new GlobalConfig();
        //设置 JavadocConfig
        globalConfig.getJavadocConfig()
                .setAuthor("jian.li");

        //设置根包
        globalConfig.getPackageConfig()
                .setBasePackage(basePackage)
        ;

        //设置表前缀和只生成哪些表，setGenerateTable 未配置时，生成所有表
        globalConfig.getStrategyConfig()
                .setTablePrefix("gen_")
                .setGenerateTables(generateTables)
                .setIgnoreColumns("id", "remark", "creator", "create_time", "updater", "update_time", "deleted", "deleted_time")//数据库字段名
        ;
        return globalConfig;
    }
}
